package com.cmc.cloud.cmclink.doc.api.document;

import com.cmc.cloud.cmclink.doc.api.document.rep.*;
import com.cmc.cloud.cmclink.doc.api.document.req.BlnoCntrRecordationRespVO;
import com.cmc.cloud.cmclink.doc.constant.DocApiConstants;
import com.cmes.framework.common.pojo.CommonResult;
import com.cmes.framework.common.pojo.PageResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
 * 提单箱况备案
 *
 * @author wdq
 */
@FeignClient(name = DocApiConstants.NAME)
@Tag(name = "RPC - 服务 提单箱况备案")
@Valid
public interface BlnoCntrRecordApi {

    String PREFIX = DocApiConstants.PREFIX + "/cntrRecord";

    /**
     * 提单箱况备案-创建
     * @param createReqVO 提单箱况备案-创建参数
     * @return 结果
     */
    @Operation(summary = "创建提单箱况备案")
    @PostMapping(PREFIX +"/create")
    CommonResult<Void> createBlnoCntrRecordation(@Valid @RequestBody BlnoCntrRecordationOperationDto createReqVO);

    /**
     * 提单箱况备案-更新
     * @param updateReqVO 提单箱况备案-更新参数
     * @return 结果
     */
    @Operation(summary = "更新提单箱况备案")
    @PostMapping(PREFIX +"/update")
    CommonResult<Void> updateBlnoCntrRecordation(@Valid @RequestBody BlnoCntrRecordationUpdateDto updateReqVO);

    /**
     * 提单箱况备案-删除
     * @param id 编号
     * @return 结果
     */
    @Operation(summary = "删除提单箱况备案")
    @PostMapping(PREFIX +"/delete/{id}")
    @Parameter(name = "id", description = "编号", required = true)
    CommonResult<Void> deleteBlnoCntrRecordation(@PathVariable("id") Long id);

    /**
     * 提单箱况备案-获得
     * @param id 编号
     * @return 结果
     */
    @Operation(summary = "获得提单箱况备案")
    @GetMapping(PREFIX +"/get/{id}")
    @Parameter(name = "id", description = "编号", required = true, example = "1024")
    CommonResult<BlnoCntrRecordationRespVO> getBlnoCntrRecordation(@PathVariable("id") Long id);

    /**
     * 提单箱况备案-获得列表
     * @param queryCntrRecord 提单箱况备案-查询参数
     * @return 提单箱况备案列表
     */
    @Operation(summary = "获得提单箱况备案列表")
    @PostMapping(PREFIX +"/recordList")
    CommonResult<List<BlnoCntrRecordationRespVO>> getCntrRecordationList(@Valid @RequestBody BlnoCntrRecordationQueryDto queryCntrRecord);

    /**
     * 提单箱况备案-获得分页
     * @param pageVO 分页查询
     * @return 分页结果
     */
    @Operation(summary = "获得提单箱况备案分页")
    @GetMapping(PREFIX +"/page")
    CommonResult<PageResult<BlnoCntrRecordationRespVO>> getBlnoCntrRecordationPage(@Valid @RequestBody BlnoCntrRecordationPageDto pageVO);
}
